package com.example.cd5160866.urlapp.view;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

public class ShadowDrawable extends Drawable {

    private Paint mPaint;

    private int mColor;

    private int mSize = 0;

    private int mLength = 0;

    @Override
    public void draw(@NonNull Canvas canvas) {
        mSize = 400;
        mLength = 400;
        mPaint = new Paint();
        mPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
        mPaint.setColor(0x00FF0000);
        mPaint.setShadowLayer(5, 0, 0, 0xFEFF0000);
//        canvas.drawCircle(200, 200, 100, mPaint);
//        canvas.draw
//                canvas.drawRect(0, 0, 380, 380, mPaint);
    }

    @Override
    public void setAlpha(@IntRange(from = 0, to = 255) int i) {
        mPaint.setAlpha(i);
    }

    @Override
    public void setColorFilter(@Nullable ColorFilter colorFilter) {
        mPaint.setColorFilter(colorFilter);
    }

    @Override
    public int getIntrinsicHeight() {
        return mSize;
    }

    @Override
    public int getIntrinsicWidth() {
        return mLength;
    }

    @Override
    public int getOpacity() {
        return PixelFormat.TRANSLUCENT;
    }
}
